<!-- Personalization Content (scaffold) -->
<div id="tabPersonalization" class="tab-content" role="tabpanel">
  <div class="endpoint-section">
    <h2>Personalization Dashboard (Preview)</h2>
    <p class="text-muted">Opt-in and basic profile. This preview allows viewing and tweaking weights and adding a memory.</p>

    <div class="form-group" style="display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end;">
      <button class="btn btn-primary" data-action="pers-view-profile">View Profile</button>
      <button class="btn" data-action="pers-opt-in">Opt-In</button>
      <button class="btn btn-danger" data-action="pers-purge">Purge</button>
    </div>

    <pre id="persProfile" class="json-viewer" style="max-height:240px; overflow:auto; background: var(--color-surface-alt);"></pre>

    <h3>Weights</h3>
    <div class="form-group" style="display:flex; gap:12px; flex-wrap:wrap;">
      <label>alpha<input id="persAlpha" type="number" step="0.05" min="0" max="1" value="0.2" style="width:90px"></label>
      <label>beta<input id="persBeta" type="number" step="0.05" min="0" max="1" value="0.6" style="width:90px"></label>
      <label>gamma<input id="persGamma" type="number" step="0.05" min="0" max="1" value="0.2" style="width:90px"></label>
      <label>half-life (days)<input id="persHalf" type="number" step="1" min="1" max="180" value="14" style="width:110px"></label>
      <button class="btn" data-action="pers-save">Save</button>
    </div>

    <h3>Add Memory</h3>
    <div class="form-group" style="display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end;">
      <input id="memContent" type="text" placeholder="Memory content" style="flex:1; min-width:260px;">
      <input id="memTags" type="text" placeholder="tags (comma separated)" style="min-width:220px;">
      <label><input id="memPinned" type="checkbox"> pinned</label>
      <button class="btn" data-action="pers-add-memory">Add</button>
      <button class="btn" data-action="pers-list-memories">List</button>
    </div>

    <pre id="memList" class="json-viewer" style="max-height:240px; overflow:auto; background: var(--color-surface-alt);"></pre>
  </div>
</div>
